package com.read.mapper;

import com.read.dto.params.NovelUserRecommendParamsDto;
import com.read.entity.NovelUserRecommend;
import org.apache.ibatis.annotations.Param;

public interface NovelUserRecommendMapper {
    int deleteByPrimaryKey(Long id);

    int insert(NovelUserRecommend record);

    int insertSelective(NovelUserRecommend record);

    NovelUserRecommend selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(NovelUserRecommend record);

    int updateByPrimaryKey(NovelUserRecommend record);

    /**
     * @description 新增用户推荐
     * @author sh-sunb6
     * @date 2019-03-05 15:31
     */
    int insertNovelUserRecommend(NovelUserRecommendParamsDto paramsDto);

    /**
     * @description 取消用户推荐
     * @author sh-sunb6
     * @date 2019-03-05 15:32
     */
    int updateNovelUserRecommendState(@Param("novelId") int novelId, @Param("userId") int userId);

    /**
     * @description 判断用户是否推荐过此本小说
     * @author sh-sunb6
     * @date 2019-03-05 15:33
     */
    int selectNovelUserRecommendCountByNovelIdUserId(@Param("novelId") int novelId, @Param("userId") int userId);
}